package com.example.pokemon_integrado;

import com.example.otherclasses.Login;

import android.app.Service;
import android.content.Intent;
import android.os.Binder;
import android.os.IBinder;
import android.util.Log;

public class LoginService extends Service
{
	private final LoginServiceBinder connection = new LoginServiceBinder();
	public Login login;
	public boolean connect;
	
	public class LoginServiceBinder extends Binder
	{
		public LoginService GetService()
		{
			return LoginService.this;
		}
	}
	
	public Login GetOperation(){ return login; }
	
	@Override
	public IBinder onBind(Intent arg0) { return connection; }

	@Override
	public void onCreate() 
	{
		super.onCreate();
		Log.d("SEND TO SERVER SERVICE", "onCreate(): ");
	}
	
	@Override
	public void onStart(Intent intent, int startId) 
	{
		super.onStart(intent, startId);
		Log.d("SEND TO HTTP SERVER SERVICE", "onStart()");	
		
		login = new Login(intent.getExtras().getString("url"));
		//connect = login.Connection();
	}
	
	@Override
	public void onDestroy() 
	{
		super.onDestroy();
		Log.d("SEND TO HTTP SERVER SERVICE", "onDestroy()");
	}
}
